package com.source.lightfowl.person.service.impl;

import com.source.lightfowl.person.dao.RolePlateDao;
import com.source.lightfowl.person.entity.Role_Plate;
import com.source.lightfowl.person.service.RolePlateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RolePlateServiceImpl implements RolePlateService {

    @Autowired
    private RolePlateDao rolePlateDao;

    @Override
    public void addRoleplate(Role_Plate rolePlate) {
        rolePlateDao.save(rolePlate);
    }

    @Override
    public void deleteRolePlate(String rid) {
        rolePlateDao.deleteByRid(rid);
    }

    @Override
    public Role_Plate querryRolePlate(String pid) {
        return rolePlateDao.findByPid(pid);
    }

    @Override
    public List<Role_Plate> querryRolePlateByPtype(String ptype, String bpid, String rid) {
        return rolePlateDao.findByPtypeAndBpid(ptype, bpid, rid);
    }

    @Override
    public List<Role_Plate> querryRolePlateByRid(String rid) {
        return rolePlateDao.findByRid(rid);
    }

    public void updateRolePlate(Role_Plate role_plate){

    }


}
